from django.http import HttpResponse
import traceback
import sys
def err_500_view(request):
    # 获取异常信息
    exc_type, exc_value, _ = sys.exc_info()

    # 获取简单的错误信息
    error_message = str(exc_value)

    return HttpResponse("服务错误,"+error_message, status=500)